/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UserMainP.java
 *
 * Created on 2012-6-4, 22:01:18
 */

package icexam.user;

import icexam.ICExamView;
import icexam.exam.ExamingPanel;
import icexam.exam.StudyPanel;

/**
 *
 * @author Ethan
 */
public class AdminMainP extends javax.swing.JPanel {

    /** Creates new form UserMainP */
    public AdminMainP() {
        initComponents();
    }

    private ICExamView mainView;
    AdminMainP(ICExamView mainView) {
        this();
        this.mainView = mainView;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        infoBut = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        studyB = new javax.swing.JButton();
        examB = new javax.swing.JButton();

        setName("Form"); // NOI18N
        setPreferredSize(new java.awt.Dimension(600, 430));
        setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 150));

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(icexam.ICExamApp.class).getContext().getResourceMap(AdminMainP.class);
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setMinimumSize(new java.awt.Dimension(227, 30));
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(500, 100));
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 20));

        infoBut.setText(resourceMap.getString("infoBut.text")); // NOI18N
        infoBut.setName("infoBut"); // NOI18N
        infoBut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                infoButActionPerformed(evt);
            }
        });
        jPanel1.add(infoBut);

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1);

        studyB.setText(resourceMap.getString("studyB.text")); // NOI18N
        studyB.setName("studyB"); // NOI18N
        studyB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studyBActionPerformed(evt);
            }
        });
        jPanel1.add(studyB);

        examB.setText(resourceMap.getString("examB.text")); // NOI18N
        examB.setName("examB"); // NOI18N
        examB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                examBActionPerformed(evt);
            }
        });
        jPanel1.add(examB);

        add(jPanel1);
    }// </editor-fold>//GEN-END:initComponents

    private void examBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_examBActionPerformed
        this.mainView.goToDBSet(new DataBaseSetPanel(mainView));
    }//GEN-LAST:event_examBActionPerformed

    private void infoButActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_infoButActionPerformed
        this.mainView.goToUserInfo(new UserSearchP(mainView));
    }//GEN-LAST:event_infoButActionPerformed

    StudyPanel sp = null;
    private void studyBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studyBActionPerformed
        this.mainView.goToModifyPSWP(new AdminModifyPSWP(mainView));
    }//GEN-LAST:event_studyBActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        this.mainView.goToModifyPSWP(new ModifyLogInPSWP());
    }//GEN-LAST:event_jButton1ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton examB;
    private javax.swing.JButton infoBut;
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton studyB;
    // End of variables declaration//GEN-END:variables

}
